<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="pageContent">
	<form method="post" id="dealerApplyDetailFormId" action="${rootUrl}/member/dealer-apply" class="pageForm required-validate" onsubmit="return validateCallback(this, newDialogAjaxDone);">
	<input type="hidden" name="_method" value="put">
		<div class="pageFormContent" layoutH="50">
			<p>
				<label>会员名：</label>
				<input value="${dealerApply.member.name}" type="text" size="30" readonly>
			</p>
			<p >
				<label>会员手机号：</label>
				<input value="${dealerApply.member.mobile}" type="text" size="30" readonly>
			</p>
			<p>
				<label>会员等级：</label><input value="${dealerApply.member.dealer.dealerLevel.level}" type="text" size="30" readonly>
			</p>
			<p>
				<label>订单编号：</label><input value="${dealerApply.code}" type="text" size="30" readonly>
			</p>
			<p>
				<label>支付单号：</label><input value="${dealerApply.payCode}" type="text" size="30" readonly>
			</p>
			<p>
				<label>支付渠道：</label><input value="${iPayChannel[dealerApply.payChannel]}" type="text" size="30" readonly>
			</p>
			<p>
				<label>支付时间：</label><input value="<fmt:formatDate value="${dealerApply.payTime}" pattern="yyyy-MM-dd HH:mm:ss" />" type="text" size="30" readonly>
			</p>
			<p>
				<label>支付积分：</label><input value="${dealerApply.joinPoint}" type="text" size="30" readonly>
			</p>
			<p>
				<label>加盟费用：</label><input value="<fmt:formatNumber value="${dealerApply.joinMoney/100}" pattern="0.00"/>" type="text" size="30" readonly>
			</p>
			<p>
				<label>申请类别：</label><input value="${dealerApply.type}" type="text" size="30" readonly>
			</p>
			<p>
				<label>域名：</label><input value="${dealerApply.domain}" type="text" size="30" readonly>
			</p>
			<p>
				<label>申请等级：</label><input value="${dealerApply.dealerLevel.level}" type="text" size="30" readonly> 
			</p>
			<p>
				<label>状态：</label>
				<c:if test="${dealerApply.state == 1}">
				<td>通过</td>
				</c:if>
				<c:if test="${dealerApply.state == 21}">
				<td>待审核</td>
				</c:if>
				<c:if test="${dealerApply.state !=1 && dealerApply.state !=21 }">
				<td>未知</td>
				</c:if>
			</p>
			<p>
				<label>申请时间：</label><fmt:formatDate value="${dealerApply.createdAt}" pattern="yyyy-MM-dd HH:mm:ss" />
			</p>
		
		</div>
		
			<c:if test="${dealerApply.state == 21}">
		<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="approved(${dealerApply.id })">审核通过</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" onclick="notApproved(${dealerApply.id })">审核不通过</button></div></div>
				</li>
			</ul>
		</div>
			</c:if>
			
	</form>
</div>


<script>
function approved(id){
	alertMsg.confirm("确定审核通过?",{
		okCall:function(){ 
			$("#dealerApplyDetailFormId").attr("action","${rootUrl}/member/dealer-apply/"+id+"/approved");
			$("#dealerApplyDetailFormId").submit();
		}
	});
}

function notApproved(id){
	alertMsg.confirm("确定审核不通过?",{
		okCall:function(){ 
			$("#dealerApplyDetailFormId").attr("action","${rootUrl}/member/dealer-apply/"+id+"/notApproved");
			$("#dealerApplyDetailFormId").submit();
		}
	});
}
		
		
</script>
